<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>

	<!-- This code written by : Willie Wheeler and John Wheeler -->
	<!-- For 'Spring In Practice' [Book written by Willie Wheeler and John Wheeler] -->

<div>
	<security:authorize ifAnyGranted="ROLE_ANONYMOUS">
		<div style="float:right;padding:2px;background-color:#CCC;">
			<form method="post" action="j_spring_security_check">
				<table>
					<tr>
						<td>Username:</td>
						<td><input type="text" name="j_username" style="width:100px" /></td>
					</tr>
					<tr>
						<td>Password:</td>
						<td><input type="password" name="j_password" style="width:100px" /></td>
					</tr>
					<tr>
						<td></td>
						<td>
							<input type="checkbox" name="_spring_security_remember_me" />
							Remember me
						</td>
					</tr>
					<tr>
						<td></td>
						<td><input type="submit" value="Log in" /></td>
					</tr>
				</table>
			</form>
		</div>
	</security:authorize>
	<security:authorize ifAnyGranted="ROLE_USER">
		<div style="float:right">
			Welcome <security:authentication property="principal.username"/>
			| <a href="account.jsp">Account</a>
			| <a href="j_spring_security_logout">Logout</a>
		</div>
	</security:authorize>
	<div style="margin-right:20px">
		<a href="index.jsp">Home</a>
		<security:authorize ifAnyGranted="ROLE_ADMIN">
			| <a href="admin.jsp">Admin</a>
		</security:authorize>
	</div>
	<div style="clear:both"></div>
</div>
